

package com.hazelcast.map.impl;

import com.hazelcast.internal.serialization.Data;

import java.io.IOException;

/**
 * MetadataInitializer is used to process and generate metadata from
 * keys and values saved in map store.
 */
public interface MetadataInitializer {

    /**
     * Returns metadata for given binary data. Implementing class decides
     * the type of the metadata returned.
     *
     * @return metadata created from given binary data
     * @throws IOException
     */
    Object createFromData(Data keyData) throws IOException;

    /**
     * Returns metadata for given object. Implementing class decides
     * the type of the metadata returned.
     * <p>
     * It is up to the implementating class to verify the type of the
     * argument.
     *
     * @return metadata created from given object
     * @throws IOException
     */
    Object createFromObject(Object object) throws IOException;
}
